package com.logic.service.impl;

import java.util.List;

import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.database.bean.BaseBean;
import com.database.bean.Setting;
import com.database.dao.AgentDao;
import com.database.dao.AgentTypeDao;
import com.database.dao.CompanyProductDao;
import com.database.dao.CompanyRoundDecisionAndResultDao;
import com.database.dao.GameDao;
import com.database.dao.GeneralDao;
import com.database.dao.NewsDao;
import com.database.dao.ProductDao;
import com.database.dao.RoundDao;
import com.database.dao.SettingDao;
import com.database.dao.SupplierDao;
import com.database.dao.UserDao;
import com.database.dao.impl.ReportDaoImpl;
import com.database.dao.impl.StatisticDaoImpl;
import com.logic.service.BaseService;

public class BaseServiceImpl implements BaseService<BaseBean>{

	@Inject
	protected GameDao gameDao;
	
	@Inject
	protected SettingDao settingDao;
	
	@Inject
	protected UserDao userDao;
	
	@Inject
	protected ProductDao productDao;
	
	@Inject
	protected CompanyProductDao companyProductDao;
	
	@Inject
	protected SupplierDao supplierDao;
	
	@Inject
	protected AgentTypeDao agentTypeDao;
	
	@Inject
	protected AgentDao agentDao;
	
	@Inject
	protected RoundDao roundDao;
	
	@Inject
	protected GeneralDao generalDao;
	
	@Inject
	protected StatisticDaoImpl statisticDao;
	
	@Inject
	protected ReportDaoImpl reportDao;
	
	@Inject
	protected NewsDao newsDao;
	
	@Inject
	protected CompanyRoundDecisionAndResultDao companyRoundDecisionAndResultDao;
	
	
	protected Logger logger = LoggerFactory.getLogger(this.getClass());

	@Override
	public BaseBean getById(Integer id) {
		return generalDao.getById(id);
	}

	@Override
	public BaseBean getById(Integer id, BaseBean bb) {
		return generalDao.getById(id, bb);
	}

	@Override
	public List<BaseBean> getAll() {
		return generalDao.getAll();
	}

	@Override
	public List<BaseBean> getAll(BaseBean bb) {
		return generalDao.getAll(bb);
	}

	@Override
	public int create(BaseBean b) {
		return generalDao.create(b);
	}

	@Override
	public int update(BaseBean b) {
		return generalDao.update(b);
	}
	
	@Override
	public int delete(BaseBean b){
		return generalDao.delete(b);
	}

	@Override
	public BaseBean refresh(BaseBean b) {
		return generalDao.refresh(b);
	}

	@Override
	public Setting getSetting() {
		return settingDao.getFirstSetting();
	}
	
	
}
